<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <base th:href="@{/}">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>header部分页面</title>
    <div th:insert ="~{common::header}"></div>
    <link rel="stylesheet" th:href="@{/css/header.css}" >
    <style>
      body, html{
        overflow: hidden;
        background-color: transparent;
      }
    </style>
</head>
<body>
<header>
  <div class="brand-logo"><a href="#" onclick="return false"><img th:src="@{images/logo.jpg}" alt="乐乐lucky服务平台" ></a></div>
  <div class="navbar-menu" style="display: none;">
      <div th:if="${session.user}">
        <span th:text="|用户: ${session.user.username}|">11111</span>
          <a th:href="@{/login/logout}" onclick="return confirm('确定要退出吗？')" target="_top" >
              <i class="mdi mdi-logout">退出</i>
          </a>
        <div th:text="|角色: ${session.roles}|">22222</div>

      </div>
      <div th:unless="${session.user}">未登录</div>
  </div>
    <div class="navbar-menu">
        <span sec:authorize="isAuthenticated()">
            已登录用户: <span sec:authentication="name"></span>
            <!--角色: <span sec:authentication="authorities"></span>-->
        </span>
        <span sec:authorize="isAnonymous()">未登录</span>
        <a sec:authorize="isAuthenticated()" th:href="@{/login/logout}" onclick="return confirm('确定要退出吗？')" target="_top" >
            <i class="mdi mdi-logout">退出系统</i>
        </a>
    </div>
</header>
</body>
</html>

